//
//  SINAStudentServiceMyEntrustModel.m
//  sinashebao
//
//  Created by  androidlongs on 2018/1/4.
//  Copyright © 2018年  androidlongs. All rights reserved.
//

#import "SINAStudentServiceMyEntrustModel.h"

@implementation SINAStudentServiceMyEntrustModel

-(instancetype)initWithDict:(NSDictionary *)dict{
    if (self==[super init]) {
        //姓名
        self.userName = [NSString stringWithFormat:@"%@", dict[@"nickname"]];
        if (self.userName.length<1||[self.userName isEqualToString:@"(null)"]) {
            self.userName =@"***";
        }
       //地址
        NSString *address =[NSString stringWithFormat:@"%@", dict[@"address"]];
        if (address.length<1||[address isEqualToString:@"(null)"]) {
            address =@"无";
        }
        self.shippingAddress = address;
        
        //条目类型
        self.itemType =[dict[@"type"] integerValue];
        
        //接单
        self.reciveSuccessOrder =dict[@"total"] ;
        if (self.reciveSuccessOrder.length<1||[self.reciveSuccessOrder isEqualToString:@"(null)"]) {
            self.reciveSuccessOrder =@"0";
        }
        
        //订单状态
        self.orderStute =dict[@"status"] ;
        
        //content 备注
        self.remark =dict[@"content"] ;
        if (self.remark.length<1||[self.remark isEqualToString:@"(null)"]) {
            self.remark =@"无";
        }
        
        self.selfUserName =dict[@"selfnickname"] ;
        if (self.selfUserName.length<1||[self.selfUserName isEqualToString:@"(null)"]) {
            self.selfUserName =@"***";
        }
        self.selfUserTitleImageUrl =dict[@"selfheadimg"] ;
        
         self.uuid =dict[@"uuid"] ;
        
        //服务类型
        self.serviceType=[NSString stringWithFormat:@"%@", dict[@"typename"]];
        if (self.serviceType.length<1||[self.serviceType isEqualToString:@"(null)"]) {
            self.serviceType =@"无";
        }
        
        //电话
        self.contactPhoneNumber=[NSString stringWithFormat:@"%@", dict[@"phone"]];
        if (self.contactPhoneNumber.length<1||[self.contactPhoneNumber isEqualToString:@"(null)"]) {
            self.contactPhoneNumber =@"***";
        }
        
        //酬金
        self.moneyNumber=[NSString stringWithFormat:@"%@", dict[@"pay"]];
        if (self.moneyNumber.length<1||[self.moneyNumber isEqualToString:@"(null)"]) {
            self.moneyNumber =@"0.0";
        }
        
        self.serviceStartTime=dict[@"starttime"];
         self.serviceStopTime=dict[@"endtime"];
        
        //头像
        self.userTitleImageUrl=dict[@"headimg"];
        [self.userTitleImageUrl stringByReplacingOccurrencesOfString:@"\\" withString:@"//"];
    }
    return self;
}
+(instancetype)askWithDic:(NSDictionary *)dict{
    
    return [[self alloc]initWithDict:dict];
}
@end
